#include <QGLWidget>
#include <QTime>

#include "grid.h"
#include "controlpanel.h"
#include "historywriter.h"
#include "C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h"

class GLWidget : public QGLWidget
{
    Q_OBJECT

    public:
        GLWidget(QWidget *parent, Grid *grid, ControlPanel *controlpanel, Grid *pdSquareIn);
        HistoryWriter histwriter;

    public slots:
        void runStimuli();
        void runRandomSpots();
        void runSequence();

        void displayNumChanged(int newDisplay);
        void resolutionChanged(QString text);
        void triggerLineChanged();

        void savePathChanged();

    protected:
        void initializeGL();
        void paintGL();

    private:
        int framenum;

        GLuint program;
        GLint attribute_coord2d;

        Grid *mothership;
        Grid *pdSquare;
        ControlPanel *cp;
        int *res;

        TaskHandle task;

        int* resolutionFromText(QString text);
};
